﻿namespace Devonline.Entity;

/// <summary>
/// 基础数据, 字符串类型的默认实现
/// </summary>
[DisplayName("基础数据")]
public class ParameterViewModel : ParameterViewModel<string>, IViewModel, IEntitySet, IKeyValuePair, IParent { }

/// <summary>
/// 通用身份抽象基类模型
/// </summary>
[DisplayName("基础数据")]
public abstract class ParameterViewModel<TKey> : EntitySetWithKeyValuePairViewModel<TKey>, IViewModel<TKey>, IEntitySet<TKey>, IKeyValuePair<TKey>, IParent<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 基础数据
    /// </summary>
    [DisplayName("文本"), Required, MaxLength(128), Excel]
    public virtual string? Text { get; set; }
    /// <summary>
    /// 父项编号
    /// </summary>
    [DisplayName("父级编号"), MaxLength(36), Excel]
    public virtual TKey? ParentId { get; set; }
}